let express = require('express');    //引入express模块
let Mock = require('mockjs');        //引入mock模块
let fs=require('fs');
let app = express();                //实例化express


app.all('*',function (req, res, next) {
    res.header('Access-Control-Allow-Origin', '*');
    res.header('Access-Control-Allow-Headers', 'Content-Type, Content-Length, Authorization, Accept, X-Requested-With , yourHeaderFeild');
    res.header('Access-Control-Allow-Methods', 'PUT, POST, GET, DELETE, OPTIONS');
   
    if (req.method == 'OPTIONS') {
      res.send(200); /让options请求快速返回/
    }
    else {
      next();
    }
})

app.get('/',(req,res)=>{
    res.json({
        "data": {
            "admin":123456,
            "password": 123456
          }
    });
})
app.get('/api',(req,res)=>{
  res.json({
      "data": [
        {"id":1,"name":"客户列表","gender":"男","phone":"8888888","province":"北京市","city":"市辖区","area":"东城区","time":"1446-44-55","vip":true},
        {"id":2,"name":"dasdas","gender":"男","phone":"150888444","province":"河北省","city":"石家庄市","area":"广阳区","time":"1446-44-55","vip":true},
        {"id":3,"name":"hewrwei","gender":"女","phone":"15884444","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":4,"name":"gqfgqgf","gender":"男","phone":"17774444","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":5,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":6,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":7,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":8,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":9,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":10,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":11,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":12,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":13,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":14,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":15,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":16,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":17,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":18,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":19,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":20,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":21,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":22,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":23,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":24,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":25,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":26,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":27,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
      ]
  });
})
// 会员列表
app.get('/member',(req,res)=>{
  res.json({
      "data": [
        {"id":1,"name":"会员列表","gender":"男","phone":"8888888","province":"北京市","city":"市辖区","area":"东城区","time":"1446-44-55","vip":true},
        {"id":2,"name":"dasdas","gender":"男","phone":"150888444","province":"河北省","city":"石家庄市","area":"广阳区","time":"1446-44-55","vip":true},
        {"id":3,"name":"hewrwei","gender":"女","phone":"15884444","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":4,"name":"gqfgqgf","gender":"男","phone":"17774444","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":5,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":6,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":7,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":8,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":9,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":10,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":11,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":12,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":13,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":14,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":15,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":16,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":17,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":18,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":19,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":20,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":21,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":22,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":23,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":24,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":25,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":26,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
        {"id":27,"name":"asdgg","gender":"男","phone":"15446666644","province":"北京市","city":"市辖区","area":"朝阳区","time":"1446-44-55","vip":true},
      ]
  });
})
// 产品分类
app.get('/product/sort',(req,res)=>{
  res.json({
    "data":[
      { id: 1,bianhao:1,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 2,bianhao:2,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 3,bianhao:3,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 4,bianhao:4,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 5,bianhao:5,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 6,bianhao:6,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 7,bianhao:7,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
      { id: 8,bianhao:8,list: "瞎吉儿分", grade: "一级",num: "100",unit: "件",nav: true,navBol:true,sort:1},
    ]
  })
})
// 预约量体表
app.get('/information/reservation',(req,res)=>{
  res.json({
    "data":[
      {id:1,name:'瞎起',gender:'男',phone:'18383838383',time:'2018/9/17 00:00:00',status:'已联系'},
      {id:1,name:'瞎起',gender:'男',phone:'18383838383',time:'2018/9/17 00:00:00',status:'已联系'},
      {id:1,name:'瞎起',gender:'男',phone:'18383838383',time:'2018/9/17 00:00:00',status:'已联系'},
      {id:1,name:'瞎起',gender:'男',phone:'18383838383',time:'2018/9/17 00:00:00',status:'已联系'},
      {id:1,name:'瞎起',gender:'男',phone:'18383838383',time:'2018/9/17 00:00:00',status:'已联系'},
      {id:1,name:'瞎起',gender:'男',phone:'18383838383',time:'2018/9/17 00:00:00',status:'已联系'},
      {id:1,name:'瞎起',gender:'男',phone:'18383838383',time:'2018/9/17 00:00:00',status:'已联系'},
      {id:1,name:'瞎起',gender:'男',phone:'18383838383',time:'2018/9/17 00:00:00',status:'已联系'},
    ]
  })
})
// 量体师申请表
app.get('/information/master',(req,res)=>{
  res.json({
    "data":[
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
    ]
  })
})

// 设计师申请表
app.get('/information/designer',(req,res)=>{
  res.json({
    "data":[
      {"id":"1","name":"设计师","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
      {"id":"1","name":"瞎起","gender":"男","phone":"11411111111","province":"北京市 东城区","years":'10',"time":"2018/9/17 00:00:00","status":"已通过"},
    ]
  })
})

//定制订单列表
app.get('/order/made',(req,res)=>{
  res.json({
    data:[
      {id:411414,idName:'啥啥啥的旗袍',name:'王亮',phone:'1535886575',time:'08.08'},
    ]
  })
})

// app.get('/',(req,res)=>{
//     res.json({
//         "name":11
//     })
// })


app.listen(8089,()=>console.log(`监听`))

